﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace RaceGame2013
{
    public class Track
    {
        // Track texture etc
        public Texture2D mTrack;
        public Texture2D mTrackOverlay;
        // For the collision checks
        public RenderTarget2D mTrackRender;
        public RenderTarget2D mTrackRenderRotated;


        // load content
        public virtual void LoadContent(ContentManager Content, GraphicsDeviceManager graphics,Voertuig voertuig,string track, string trackOverlay)
        {
            // Load the track
            mTrack = Content.Load<Texture2D>(track);

            // load overlay texture
            mTrackOverlay = Content.Load<Texture2D>(trackOverlay);

            // Setup the render targets to be used in determining if the car is on the track
            mTrackRender = new RenderTarget2D(graphics.GraphicsDevice, voertuig.width + 100, voertuig.height + 100, true, SurfaceFormat.Color, DepthFormat.None);
            mTrackRenderRotated = new RenderTarget2D(graphics.GraphicsDevice, voertuig.width + 100, voertuig.height + 100, true, SurfaceFormat.Color, DepthFormat.None);
                
        }

        // The update method
        public void Update(GameTime gameTime)
        {


            
        }
            
        // Draw
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(mTrackOverlay , new Rectangle(0, 0, mTrackOverlay.Width, mTrackOverlay.Height), Color.White);
            
        }



    }
}
